# -*- coding: utf8 -*-

from django.conf.urls.defaults import *
from relationships import views as relationship_views

urlpatterns = patterns('relationships.views',

    # Add Relationship Status by requested user
    url(r'^add/$', relationship_views.RelationshipStatusAdd.as_view(),
                        name='relationshipstatus_add'),
                       
    # Update Relationship Status by requested user Require GET username + id
    # view = relationship_views -> class = RelationshipStatusUpdate
    # name = name for this url
    # ex. /circle/<username>/<id>/update
    url(r'^(?P<pk>\d+)/update/$', relationship_views.RelationshipStatusUpdate.as_view(),
                        name='relationshipstatus_update'),
                       
    # Delete Relationship Status by requested user Require GET username + id
    url(r'^(?P<pk>\d+)/delete/$', relationship_views.RelationshipStatusDelete.as_view(),
                        name='relationshipstatus_delete'),
                       
    # List RelationshipsStatus for requested users
    url(r'^$',
       relationship_views.RelationshipStatusListView.as_view(),
       name='relationshipstatus_list'),
   
    # Ajax save Relationship
    url(r'^relation_ajax/$', 'RelationshipsAjax'),
    
    # List Relationship for RelationshipStatus within requested user
    url(r'^(?P<status_slug>[\w\ ]+)/$',
       relationship_views.RelationshipListView.as_view(),
       name='relationship_list'),
                       
    # List Relationship which related_to request user
    url(r'^to_user_list/(?P<status_slug>[\w\ ]+)/$',
       relationship_views.RelationshipListToUserView.as_view(),
       name='relationship_to_user_list'),
    
    # Update Relationship Status by requested user
    url(r'^add/(?P<status_id>\d+)/$', 
        relationship_views.RelationshipsAdd.as_view(),
        name='relationship_add'),
                       
    url(r'^delete/(?P<pk>\d+)/(?P<status_slug>[\w\ ]+)/$', 
        relationship_views.RelationshipsDelete.as_view(), 
        name='relationship_delete'),
                       
    
)
